pub fn goldbach_conjecture() -> u64 {
    // generate prime numbers
    let mut prime = [0u64; 5000];
    let mut is_prime = [true; 10000];
    let mut prime_count = 0;
    for i in 2..10000 {
        if is_prime[i] {
            prime[prime_count] = i as u64;
            prime_count += 1;
            let mut j = i * i;
            while j < 10000 {
                is_prime[j] = false;
                j += i;
            }
        }
    }
    let goldbach_after = |start| -> u64 {
        for i in (start + 2..).step_by(2) {
            if !is_prime[i as usize] {
                let mut found = false;
                for j in prime {
                    if j > i {
                        break;
                    }
                    let mut k = i - j;
                    if k % 2 == 1 {
                        continue;
                    }
                    k /= 2;
                    if (k as f64).sqrt() as u64 * (k as f64).sqrt() as u64 == k {
                        found = true;
                        break;
                    }
                }
                if !found {
                    return i;
                }
            }
        }
        0
    };
    goldbach_after(7) + goldbach_after(goldbach_after(7))
}
